package com.hyt.it.ogt.kq.common.gov.enums.admission;

import cn.hutool.core.util.NumberUtil;
import lombok.Getter;

/**
 * 准考证科目生成设置
 *
 * @author zhoumiao
 * @since 2023/2/2 11:48
 **/
@Getter
public enum TicketSubjectSettingEnum {

    NONE(0, "无"),
    SINGLE(1, "单科目生成"),
    MORE(2, "多科目生成"),
    ;

    private Integer code;
    private String text;

    TicketSubjectSettingEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public static TicketSubjectSettingEnum getByCode(Integer code) {
        for (TicketSubjectSettingEnum ticketSubjectSettingEnum : values()) {
            if (NumberUtil.equals(ticketSubjectSettingEnum.getCode(), code)) {
                return ticketSubjectSettingEnum;
            }
        }
        return NONE;
    }
}
